package com.ftg.learn.mapper;

import com.ftg.learn.dto.TeacherSaveDto;
import com.ftg.learn.dto.TeacherUpdateDto;
import com.ftg.learn.entity.TeacherEntity;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 描述
 *
 * @author 布衣
 * @date 2025/8/7
 */
public interface TeacherMapper {

    List<TeacherEntity> getAll();

    @Insert("insert into learn_teacher(tea_name,tea_sex) values(#{tea.teaName},#{tea.teaSex})")
    int saveTeacher(@Param("tea") TeacherSaveDto teacherEntity);

    @Update("update learn_teacher set tea_name=#{tea.teaName},tea_sex=#{tea.teaSex} where id=#{tea.id}")
    int modifyTeacher(@Param("tea") TeacherUpdateDto teacherEntity);

    @Select("select * from learn_teacher where id=#{id}")
    TeacherEntity findOneById(@Param("id") Integer id);

    @Delete("delete from learn_teacher where id=#{id}")
    int deleteById(@Param("id") Integer id);
}
